package com.javatest.springboottest01.command;

import com.javatest.springboottest01.async.AsyncTask;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CommandService {

    @Bean
    CommandLineRunner asyncTaskClr(AsyncTask asyncTask) {
        return args -> {
            for (int i = 0; i < 10; i++) {
                asyncTask.loopPrint(i);
            }

            for (int i = 0; i < 10; i++) {
                asyncTask.loopPrint2(i);
            }
        };
    }
}
